package com.cap.dreamcircle.View;

import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.cap.dreamcircle.App.App;
import com.cap.dreamcircle.Base.BaseActivity;
import com.cap.dreamcircle.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by liucxu on 2018/3/16.
 */

public class ChangePhoneNumActivity extends BaseActivity {

    @BindView(R.id.imv_back)
    ImageView imv_back;
    @BindView(R.id.tv_bind_phone)
    TextView tv_bind_phone;
    @BindView(R.id.tv_change_phone_num)
    TextView tv_change_phone_num;

    private String phoneNum;

    @Override
    public int getLayoutId() {
        return R.layout.activity_change_phone_num;
    }

    @Override
    public void setupView() {
        ButterKnife.bind(this);
    }

    @Override
    public void setupData() {
        phoneNum=getIntent().getStringExtra("key_phone_num");
        if (TextUtils.isEmpty(phoneNum)) {
            tv_change_phone_num.setText("绑定");
        } else {
            tv_bind_phone.setText(phoneNum);
            tv_change_phone_num.setText("更换");
        }
    }

    @OnClick({R.id.imv_back, R.id.layout_change_phone_num})
    void doClicks(View view) {
        int id = view.getId();
        switch (id) {
            case R.id.imv_back:
                App.GetInstance().finishActivity(ChangePhoneNumActivity.this);
                break;
            case R.id.layout_change_phone_num:
                Intent intent=new Intent(ChangePhoneNumActivity.this,SettingBindPhoneNumActivity.class);
                startActivity(intent);
                break;
        }
    }
}
